package com.gitee.faster.webdav.kernel.model;

import jakarta.xml.bind.annotation.*;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Collections;
import java.util.List;

/**
 * @author hongda.li
 */
@SuppressWarnings("SpellCheckingInspection")
@Data
@Accessors(chain = true)
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
        "content"
})
@XmlRootElement(name = "getcontentlength")
public class GetContentLength {

    @XmlMixed
    private List<String> content;

    public static GetContentLength byLength(long length) {
        GetContentLength contentLength = new GetContentLength();
        contentLength.setContent(Collections.singletonList(Long.toString(length)));
        return contentLength;
    }
}
